<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class AccountResource extends JsonResource
{
	public function toArray($request)
	{
		$resource = $this->resource;
		
		return [
			'id'                        => (int)$resource->id,
			'user_id'                   => (int)$resource->user_id,
			'money'               		 => $resource->money ?? '0',
			'user'                      => new UserResource($this->user),
		];
	}
}
